<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> 
<head>
<title>TypeFinder Sample</title>
<link rel="stylesheet" type="text/css" href="../../../docs/rotor.css">
</head>

<body>		


<h1> TypeFinder Sample</h1>


<h2>Sample Overview</h2>


<p>This sample tool provides the user with a command-line interface to provide 
information about types in the environment. Locating a specific type 
can be difficult. This tool provides a simple way o determine what types are 
available, what module they are in and what interfaces, methods, fields, 
properties and events are available on the type. </p>


<p>This sample demonstrates the use of the following classes:</p>


<ul>
  <li><b>Reflection</b><ul>
    <li><b>Assembly</b><ul>
    <li>Used to load assemblies into the application domain so that 
    they can be searched for types. </li>
  </ul>
    </li>
  </ul>
  <ul>
    <li><b>Module</b><ul>
    <li>Used to get types from the assembly or module for 
    comparison to the search string. </li>
  </ul>
    </li>
  </ul>
  <ul>
    <li><b>Type</b><ul>
    <li>Used to get type information such as its name, namespace, 
    and members. </li>
  </ul>
    </li>
  </ul>
  <ul>
    <li><b>PropertyInfo</b><ul>
    <li>Used to find information about properties in types. </li>
  </ul>
    </li>
  </ul>
  <ul>
    <li><b>EventInfo</b><ul>
    <li>Used to find information about events in types. </li>
  </ul>
    </li>
  </ul>
  <ul>
    <li><b>FieldInfo</b><ul>
    <li>Used to find information about fields in types. </li>
  </ul>
    </li>
  </ul>
  <ul>
    <li><b>MethodInfo</b><ul>
    <li>Used to find information about methods in types. </li>
  </ul>
    </li>
  </ul>
  </li>
  <li><b>IO</b><ul>
    <li><b>TextWriter</b><ul>
    <li>Used by the IndentedWriter sample type to output (to 
    the console, by default) in a generic fashion. </li>
  </ul>
    </li>
  </ul>
  </li>
  <li><b>Text</b><ul>
    <li><b>StringBuilder</b><ul>
    <li>Used by the IndentedWriter sample type to create a 
    string. </li>
  </ul>
    </li>
  </ul>
  <ul>
    <li><b>String</b><ul>
    <li>Used throughout the sample to find format strings,  sub-strings, upper-case strings, 
    and so on. </li>
  </ul>
    </li>
  </ul>
  </li>
  <li><b>Collections</b><ul>
    <li><b>ArrayList</b><ul>
    <li>Used by the sample to manage a growable list of 
    strings. </li>
  </ul>
    </li>
  </ul>
  </li>
  <li><b>Registry</b><ul>
    <li><b>Registry</b><ul>
    <li>Used to create an instance of the RegistryKey type for 
    a subkey of the LocalMachine key. </li>
  </ul>
    </li>
  </ul>
  <ul>
    <li><b>RegistryKey</b><ul>
    <li>Used to read values from a key in the registry. </li>
  </ul>
    </li>
  </ul>
  </li>
</ul>


<h4>Usage</h4>


<blockquote>


<p>typefinder -d:<i>directory</i> [<i>MatchOptions</i>] [<i>ShowOptions</i>] [<i>MiscOptions</i>] <i>
typename</i></p>


</blockquote>


<p>Where <i>typename</i> is the name of the type to search for.</p>


<table border="1" width="90%">
  <tr>
    <th width="29%" valign="top">Option</th>
    <th width="71%" colspan="2" valign="top">Description</th>
  </tr>
  <tr>
    <td width="29%" valign="top"><b>-d</b>:<i>directory</i></td>
    <td width="71%" colspan="2" valign="top">Specifies additional directory to 
    search.</td>
  </tr>
  <tr>
    <td width="29%" rowspan="3" valign="top"><i>MatchOptions</i></td>
    <td width="6%" valign="top"><b>-n</b></td>
    <td width="65%" valign="top">Specifies namespace name.</td>
  </tr>
  <tr>
    <td width="6%" valign="top"><b>-w</b></td>
    <td width="65%" valign="top">Matches the name anywhere in the namespace.</td>
  </tr>
  <tr>
    <td width="6%" valign="top"><b>-x</b></td>
    <td width="65%" valign="top">Specifies exact type name (including 
    namespace).</td>
  </tr>
  <tr>
    <td width="29%" rowspan="7" valign="top"><i>ShowOptions</i></td>
    <td width="22%" valign="top"><b>-a</b></td>
    <td width="49%" valign="top">Shows all information.</td>
  </tr>
  <tr>
    <td width="22%" valign="top"><b>-e </b></td>
    <td width="49%" valign="top">Shows events.</td>
  </tr>
  <tr>
    <td width="22%" valign="top"><b>-f</b></td>
    <td width="49%" valign="top">Shows fields.</td>
  </tr>
  <tr>
    <td width="22%" valign="top"><b>-i </b></td>
    <td width="49%" valign="top">Shows interfaces.</td>
  </tr>
  <tr>
    <td width="22%" valign="top"><b>-l</b></td>
    <td width="49%" valign="top">Shows module information.</td>
  </tr>
  <tr>
    <td width="22%" valign="top"><b>-m</b></td>
    <td width="49%" valign="top">Shows methods.</td>
  </tr>
  <tr>
    <td width="22%" valign="top"><b>-p</b></td>
    <td width="49%" valign="top">Shows properties.</td>
  </tr>
  <tr>
    <td width="29%" valign="top" rowspan="3"><i>MiscOptions</i></td>
    <td width="36%" valign="top"><b>-?</b></td>
    <td width="35%" valign="top">Prints usage information.</td>
  </tr>
  <tr>
    <td width="36%" valign="top"><b>-r </b></td>
    <td width="35%" valign="top">Displays base type information for every type.</td>
  </tr>
  <tr>
    <td width="36%" valign="top"><b>-v</b></td>
    <td width="35%" valign="top">Specifies verbose mode.</td>
  </tr>
  </table>



<h2>Sample Source and Build Output Locations</h2>


<p>The sample source is found in sscli20\samples\utilities\typefinder.&nbsp; </p>


<p>The source file is:</p>


<ul class="none">
  <li><a href="typefinder.cs">typefinder.cs</a></li>
</ul>


<p>The build output location is %_NTTREE%\samples\utilities\typefinder.&nbsp; 
The output file is an executable assembly named typefinder.exe.</p>


<h2>Building the Sample</h2>


<p>All samples are built from the buildall script.&nbsp;  </p>


<p>You can also build all the 
samples by switching to the root of the sample directory, sscli20\samples, and typing 
<code>build -c</code>.</p>


<p>You can build this specific sample  by switching to the sample directory and typing 
<code>build -c</code>.</p>


<h2>Running the Sample</h2>


<p>These steps require that the Shared Source CLI (SSCLI) be already built and 
functional.</p>


<ol>
  <li>Run  env.bat. </li>
  <li>Switch to the %_NTTREE%\samples\utilities\typefinder directory.</li>
  <li>Type the following command:<blockquote>


<p>clix typefinder.exe</p>


  </blockquote>


  </li>
</ol>


<hr>


<p><i>Copyright (c) 2006 Microsoft Corporation. All rights reserved.</i></p>
</body> 
</html>